package com.own.business.message.center.controller.user;

import com.own.business.message.center.business.service.MessageCenterGroupChildService;
import com.own.business.message.center.entity.query.MessageCenterGroupChildQuery;
import com.own.business.message.center.entity.vo.MessageCenterGroupChildVo;
import com.own.component.common.base.controller.BaseController;
import com.own.component.common.model.R;
import com.own.component.common.model.ResultModel;
import com.own.component.log.operation.aop.LogOperationAop;
import com.own.component.log.operation.aop.LogOperationModuleAop;
import com.own.constant.ConstantApiPrefix;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * UserMessageCenterGroupChildController
 *
 * @author chenxueli
 * @date 2023-11-13 18:17:40
 */
@Tag(name = "消息中心分组子级" + ConstantBeanSuffix.USER_CLIENT + ConstantBeanSuffix.CONTROLLER)
@RestController
@LogOperationModuleAop("消息中心分组子级" + ConstantBeanSuffix.USER_CLIENT)
@RequestMapping(ConstantApiPrefix.BASE_API_V1_PREFIX + ConstantApiPrefix.USER_CLIENT + "message/center/group/child")
public class UserMessageCenterGroupChildController extends BaseController {

    @Resource
    private MessageCenterGroupChildService messageCenterGroupChildService;

    @LogOperationAop
    @Operation(summary = "获取所有的分组子级信息（前端缓存用）")
    @GetMapping("/all")
    public ResultModel<List<MessageCenterGroupChildVo>> all() {
        var list = messageCenterGroupChildService.all(new MessageCenterGroupChildQuery());
        return R.success(list);
    }

}
